<?php
class InterfaceLog extends SDK_Log
{
	public function __construct($name)
	{
		if (defined('LOCAL_TEST')) {
			parent::__construct($name);
		} else {
			$this->token = $name;
        	$this->logger = new OaLog("LOG_INTERFACE", "", array("lineFormat"=>'%1$s%2$s	%3$s	%4$s', 'timeFormat'=>"%Y-%m-%d %H:%M:%S")); 
		}
	}
    
	public static function &getLogInstance ($name)
    {
    	if (defined('LOCAL_TEST')) {
        	try {
        		Logger::configure(dirname(__FILE__) . '/../config/log4php.conf.php');
	            $logger = &self::getLogger($name);	            
	            return $logger;
	        } catch (LoggerException $e) {
	            return FALSE;
	            #show_error($e->getMessage());
	        #echo $e->getTraceAsString();
	        }
        } else {
	    	try {
	            //$configs = parse_ini_file(SDK_CONFIGS_PATH . 'log4php.conf.php');
	            $logger = &new InterfaceLog($name);
	            return $logger;
	        } catch (Exception $e) {
	            return FALSE;
	        }
        }
        return FALSE;
    }
}